<?php
namespace app\models;

class UserCreditLog extends IModel {
    public $table = 't_user_credit_log';

    public static $ACTION_POST_COMMENT = 1;
    public static $ACTION_POST_ARTICLE = 2;
    public static $ACTION_SYSTEM_BUY = 11;

    public static function getActionName($action) {
        $name = '';

        switch(intval($action)) {
            case static::$ACTION_POST_COMMENT:
                $name = '发布评论';
                break;
            case static::$ACTION_POST_ARTICLE:
                $name = '发布文章';
                break;
            case static::$ACTION_SYSTEM_BUY:
                $name = '购买';
                break;
            default:
                break;
        }

        return $name;
    }
}
